<p>
<%= f.label :throttle -%><br/>
<%= f.radio_button :throttle_opt, 'off', :checked => true -%> <%= f.label :throttle, 'Unlimited', :value => 'off' -%><br/>
<%= f.radio_button :throttle_opt, 'on' -%> <%= f.text_field :throttle, :size => 4 -%> <%= f.label :throttle, 'messages per minute', :value => 'on' -%><br/>
</p>
<script>
$(function() {
  $("#channel_throttle_opt_on").click(function() {
    $("#channel_throttle").attr('disabled', false);
    $("#channel_throttle").focus();
  });
  $("#channel_throttle_opt_off").click(function() {
    $("#channel_throttle").attr('disabled', true);
  });
  if ($("#channel_throttle_opt_off").attr('checked')) {
    $("#channel_throttle").attr('disabled', true);
  }
});
</script>
